package com.zhang.member.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.zhang.common.util.result.R;
import com.zhang.member.entity.MemberReceiveAddress;

import java.util.List;

/**
* @author hongmizfb
* @description 针对表【my_member_receive_address(会员收货地址)】的数据库操作Service
* @createDate 2023-11-27 11:35:58
*/
public interface IMemberReceiveAddressService extends IService<MemberReceiveAddress> {

    /**新增收货地址
     * @param memberReceiveAddress
     */
    R addOne(MemberReceiveAddress memberReceiveAddress);

    List<MemberReceiveAddress> listByUserId(Long userId);

    /**将用户的默认地址修改为普通地址
     * @param userId
     */
    void updateDefalutToNoByUserId(Long userId);

    /**批量删除收货地址
     * @param addressIds
     */
    void delByIds(List<Long> addressIds);

    /**获取用户的默认收货地址
     * @param userId
     * @return {@link MemberReceiveAddress}
     */
    MemberReceiveAddress getDefaultByUserId(Long userId);
}
